import Foundation

public class RSAEncrypt {

    public func sign(plainStr: String, priKey: String) -> String {
        //签名时 私钥需要是pkcs1格式
        return RsaEncryptor.sign(plainStr, withPriKey: priKey)
    }
    
    public func verify(plainStr: String, signStr: String, pubKey: String) -> Bool {
        return RsaEncryptor.verify(plainStr, signature: signStr, withPublivKey: pubKey)
    }
    
    public func encrypt(plainTxt: String, pubKey: String) -> String {
        return RsaEncryptor.encryptString(plainTxt, publicKey: pubKey)
    }
    
    public func decrypt(encryptStr: String, priKey: String) -> String {
        // 加密时 私钥需要是PKCS8
        return RsaEncryptor.decryptString(encryptStr, privateKey: priKey)
    }

    
}
